home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha Extra 2004 January / CyberMycha Extra 1-2004 (Poland) (Disc 2).bin / Pippi / common.cst / 00049_slider.ls < prev    next >
Encoding:
Text File  |  2001-09-04  |  894 b   |  37 lines

  1. property meSprite, baseSprite, myNum, zeroLocH, fullLocH
  2.  
  3. on beginSprite me
  4.   meSprite = sprite(me.spriteNum)
  5.   baseSprite = sprite((me.spriteNum) - 1)
  6.   if the soundLevel = 0 then set the soundLevel = 1
  7.   myNum = the soundLevel
  8.   zeroLocH = baseSprite.locH - 50
  9.   fullLocH = zeroLocH + 98
  10. end
  11.  
  12. on setUp me
  13.   v = the soundLevel * 14
  14.   meSprite.loc = point(zeroLocH + v, meSprite.locV)
  15. end
  16.  
  17. on mouseDown me
  18.   repeat while the mouseDown
  19.     if the mouseH < fullLocH and the mouseH > zeroLocH then
  20.       meSprite.loc = point(the mouseH, meSprite.locV)
  21.       updateStage
  22.     else if the mouseH >= fullLocH then
  23.       meSprite.loc = point(fullLocH, meSprite.locV)
  24.       updateStage
  25.     else if the mouseH <= zeroLocH then
  26.       meSprite.loc = point(zeroLocH, meSprite.locV)
  27.       updateStage
  28.     end if
  29.     v = ((meSprite.locH - zeroLocH) / 14) + 1
  30.     the soundLevel = v
  31.   end repeat
  32.   beep
  33. end
  34.  
  35.  
  36.  
  37.